/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * si_ingresar.java
 *
 * Created on 9/09/2013, 04:21:45 PM
 */

package si_rhnominafacil;


import javax.swing.*;
import javax.swing.JOptionPane;
import java.sql.*;
import org.jdesktop.application.Action;

import java.io.*;
import java.util.*;
/**
 *
 * @author michelle
 */
public class si_ingresar extends javax.swing.JDialog {

        private si_conectar x = new si_conectar() ;

    private ResultSet rs = null;
    /** Creates new form si_ingresar */
    public si_ingresar(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
private void ingresar() {
        // TODO add your handling code here:
        String registros="";
        int nive=0;
        si_variables.setHost(this.jtf_sitio1.getText());

        si_variables.setBd(this.jtf_basedatos.getText());
        si_variables.setLogin(this.jtf_usua.getText());
        si_variables.setPassword(this.jpw_contra.getText());

        si_variables.setDescribeaplicacion(this.jtf_sistematitulo.getText());

        si_variables.setbdLogin("postgres"); //servidor punta de venta

        si_variables.setbdPassword("debianpostgres2011");// servidor punto venta



       //se creaa la variable resultset

       //llamo almetodo para establecer la conexion
       x.estableceConexion();
        //verifico si marque el error en global
       if (si_variables.getError_ingreso()==-1)
            {
                JOptionPane.showMessageDialog(null,"no se pudo ingresar al sistema", "Error",1);
                this.jtf_usua.setText("");
                this.jpw_contra.setText("");
                this.jtf_usua.requestFocus();
            }
       else
            {
            String texto="select * from usuario_ingresar(1,'"+si_variables.getLogin()+"','"+si_variables.getPassword()+"','','') as (nombre character varying(80),nivel smallint);";
            System.out.println(texto);
            try
                {
                rs=x.sieuno_executediversosv2(texto,si_variables.getconexiongral());
                while (rs.next())
                        {
                            registros="1";
                            nive=rs.getInt(2);
                            si_variables.setnivelusu(nive);
                        }

                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }
               if ((!(registros.equals(""))) && (!(registros.equals("0"))))
                        {
                            JOptionPane.showMessageDialog(null,"Bienvenido al "+this.jtf_sistematitulo.getText(),"Sistema Integral:Bienvenida",1);
                            this.dispose();
                        }
                    else
                        {
                            JOptionPane.showMessageDialog(null,"no se pudo ingresar al sistema", "Error",1);
                            this.jtf_usua.setText("");
                            this.jpw_contra.setText("");
                            this.jtf_usua.requestFocus();
                        }
            }
}
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jtf_usua = new javax.swing.JTextField();
        jtf_unidaddatos = new javax.swing.JTextField();
        jtf_sistemasitiofotos = new javax.swing.JTextField();
        jbtn_enter = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jpw_contra = new javax.swing.JPasswordField();
        jCheckBox1 = new javax.swing.JCheckBox();
        jtf_sistematitulo = new javax.swing.JTextField();
        jbtn_exit = new javax.swing.JButton();
        jbtn_helpayudame = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jep_invitacion = new javax.swing.JEditorPane();
        jtf_carpetaservidor = new javax.swing.JTextField();
        jtf_basedatos = new javax.swing.JTextField();
        jtf_sitioexterno = new javax.swing.JTextField();
        jtf_sitio1 = new javax.swing.JTextField();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jmni_salir = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jmni_escape = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setName("Form"); // NOI18N

        jPanel1.setName("jPanel1"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(si_rhnominafacil.Si_rhnominafacilApp.class).getContext().getResourceMap(si_ingresar.class);
        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jtf_usua.setName("jtf_usua"); // NOI18N
        jtf_usua.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_usuaActionPerformed(evt);
            }
        });

        jtf_unidaddatos.setText(resourceMap.getString("jtf_unidaddatos.text")); // NOI18N
        jtf_unidaddatos.setName("jtf_unidaddatos"); // NOI18N
        jtf_unidaddatos.setPreferredSize(new java.awt.Dimension(59, 20));
        //jtf_basedatos.setText("SIE");
        //jtf_sitio.setText("localhost/SIE");
        jtf_unidaddatos.setVisible(false);

        jtf_sistemasitiofotos.setText(resourceMap.getString("jtf_sistemasitiofotos.text")); // NOI18N
        jtf_sistemasitiofotos.setName("jtf_sistemasitiofotos"); // NOI18N
        jtf_sistemasitiofotos.setPreferredSize(new java.awt.Dimension(59, 20));
        //jtf_basedatos.setText("SIE");
        //jtf_sitio.setText("localhost/SIE");
        jtf_sistemasitiofotos.setVisible(false);

        jbtn_enter.setIcon(resourceMap.getIcon("jbtn_enter.icon")); // NOI18N
        jbtn_enter.setText(resourceMap.getString("jbtn_enter.text")); // NOI18N
        jbtn_enter.setName("jbtn_enter"); // NOI18N
        jbtn_enter.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_enterActionPerformed(evt);
            }
        });

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jpw_contra.setName("jpw_contra"); // NOI18N
        jpw_contra.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jpw_contraActionPerformed(evt);
            }
        });

        jCheckBox1.setSelected(true);
        jCheckBox1.setName("jCheckBox1"); // NOI18N
        jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox1ActionPerformed(evt);
            }
        });

        jtf_sistematitulo.setText(resourceMap.getString("jtf_sistematitulo.text")); // NOI18N
        jtf_sistematitulo.setName("jtf_sistematitulo"); // NOI18N
        jtf_sistematitulo.setPreferredSize(new java.awt.Dimension(59, 20));
        //jtf_basedatos.setText("SIE");
        //jtf_sitio.setText("localhost/SIE");
        jtf_sistematitulo.setVisible(false);

        jbtn_exit.setIcon(resourceMap.getIcon("jbtn_exit.icon")); // NOI18N
        jbtn_exit.setText(resourceMap.getString("jbtn_exit.text")); // NOI18N
        jbtn_exit.setName("jbtn_exit"); // NOI18N
        jbtn_exit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_exitActionPerformed(evt);
            }
        });

        jbtn_helpayudame.setIcon(resourceMap.getIcon("jbtn_helpayudame.icon")); // NOI18N
        jbtn_helpayudame.setText(resourceMap.getString("jbtn_helpayudame.text")); // NOI18N
        jbtn_helpayudame.setName("jbtn_helpayudame"); // NOI18N
        jbtn_helpayudame.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_helpayudameActionPerformed(evt);
            }
        });

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jep_invitacion.setContentType(resourceMap.getString("jep_invitacion.contentType")); // NOI18N
        jep_invitacion.setEditable(false);
        jep_invitacion.setText(resourceMap.getString("jep_invitacion.text")); // NOI18N
        jep_invitacion.setName("jep_invitacion"); // NOI18N
        jScrollPane1.setViewportView(jep_invitacion);

        jtf_carpetaservidor.setText(resourceMap.getString("jtf_carpetaservidor.text")); // NOI18N
        jtf_carpetaservidor.setName("jtf_carpetaservidor"); // NOI18N
        jtf_carpetaservidor.setPreferredSize(new java.awt.Dimension(59, 20));
        //jtf_basedatos.setText("SIE");
        //jtf_sitio.setText("localhost/SIE");
        jtf_carpetaservidor.setVisible(false);

        jtf_basedatos.setText(resourceMap.getString("jtf_basedatos.text")); // NOI18N
        jtf_basedatos.setName("jtf_basedatos"); // NOI18N
        jtf_basedatos.setPreferredSize(new java.awt.Dimension(59, 20));
        //jtf_basedatos.setText("SIE");
        //jtf_sitio.setText("localhost/SIE");
        jtf_basedatos.setVisible(false);

        jtf_sitioexterno.setText(resourceMap.getString("jtf_sitioexterno.text")); // NOI18N
        jtf_sitioexterno.setName("jtf_sitioexterno"); // NOI18N
        jtf_sitioexterno.setPreferredSize(new java.awt.Dimension(59, 20));
        //jtf_sitio.setText("localhost/SIE");
        jtf_sitioexterno.setVisible(false);

        jtf_sitio1.setText(resourceMap.getString("jtf_sitio1.text")); // NOI18N
        jtf_sitio1.setName("jtf_sitio1"); // NOI18N
        jtf_sitio1.setPreferredSize(new java.awt.Dimension(59, 20));
        //jtf_sitio.setText("localhost/SIE");
        jtf_sitio1.setVisible(false);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(jLabel1)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jtf_usua, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jtf_unidaddatos, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(21, 21, 21)
                            .addComponent(jtf_sistemasitiofotos, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                    .addComponent(jLabel2)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jpw_contra, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jCheckBox1)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jtf_sistematitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGap(3, 3, 3)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jtf_sitio1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_sitioexterno, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_basedatos, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_carpetaservidor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jbtn_helpayudame, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jbtn_exit, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jbtn_enter, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel1)
                                    .addComponent(jtf_usua, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jtf_unidaddatos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(11, 11, 11)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jpw_contra, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jtf_sistematitulo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jCheckBox1)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jtf_sistemasitiofotos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(31, 31, 31)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jtf_sitio1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtf_sitioexterno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtf_basedatos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtf_carpetaservidor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jbtn_enter, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbtn_exit, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbtn_helpayudame, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N

        jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
        jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
        jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
        jmni_salir.setName("jmni_salir"); // NOI18N
        jmni_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_salirActionPerformed(evt);
            }
        });
        jMenu1.add(jmni_salir);

        jMenuBar1.add(jMenu1);

        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
        jMenu2.setName("jMenu2"); // NOI18N

        jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
        jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
        jmni_escape.setName("jmni_escape"); // NOI18N
        jmni_escape.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_escapeActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_escape);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jtf_usuaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_usuaActionPerformed
        this.jpw_contra.requestFocus();        // TODO add your handling code here:
}//GEN-LAST:event_jtf_usuaActionPerformed

    private void jbtn_enterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_enterActionPerformed
        // TODO add your handling code here:
        String texto = this.jtf_usua.getText();
        String texto2 = this.jpw_contra.getText();

        if((!("".equals(texto))) &&(!("".equals(texto2)))) {
            this.ingresar();
        } else {
            this.jtf_usua.requestFocus();
        }
        //this.dispose();
}//GEN-LAST:event_jbtn_enterActionPerformed

    private void jpw_contraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jpw_contraActionPerformed
        // TODO add your handling code here:
        String texto = this.jtf_usua.getText();
        String texto2 = this.jpw_contra.getText();
        if((!("".equals(texto))) &&(!("".equals(texto2)))) {
            this.ingresar();
        } else {
            this.jtf_usua.requestFocus();
        }
    }//GEN-LAST:event_jpw_contraActionPerformed

    private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
        // TODO add your handling code here:
        this.jpw_contra.requestFocus();
        this.jbtn_enterActionPerformed(evt);
}//GEN-LAST:event_jCheckBox1ActionPerformed

    private void jbtn_exitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_exitActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Realmente Desea Salir?")==0) {
            System.exit(0);// para cerrar la aplicacion
        }
}//GEN-LAST:event_jbtn_exitActionPerformed

    private void jbtn_helpayudameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_helpayudameActionPerformed
        // TODO add your handling code here:
        JOptionPane.showMessageDialog(null," 1.-Sistema de nivel Administrativo ingreso de Gerentes,supervision,almacen etc\n 2.- El sistema Distingue de Mayusculas y Minusculas(ejemplo:\"usuario\" no es igual que \"Usuario\" )\n 3:Respecto al punto 2 si a intentado entrar al sistema y no lo logra verifique el estado de su teclado\n 4.- Si no puede ingresar Comuniquese con su administrador", "Ingreso Al Sistema: Ayuda",1);
        this.jtf_usua.requestFocus();
}//GEN-LAST:event_jbtn_helpayudameActionPerformed

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
                 if(JOptionPane.showConfirmDialog(null, "Realmente Desea Salir?")==0)
            {
               System.exit(0);// para cerrar la aplicacion
            }
}//GEN-LAST:event_jmni_salirActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jmni_escapeActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                si_ingresar dialog = new si_ingresar(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton jbtn_enter;
    private javax.swing.JButton jbtn_exit;
    private javax.swing.JButton jbtn_helpayudame;
    private javax.swing.JEditorPane jep_invitacion;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JPasswordField jpw_contra;
    private javax.swing.JTextField jtf_basedatos;
    private javax.swing.JTextField jtf_carpetaservidor;
    private javax.swing.JTextField jtf_sistemasitiofotos;
    private javax.swing.JTextField jtf_sistematitulo;
    private javax.swing.JTextField jtf_sitio1;
    private javax.swing.JTextField jtf_sitioexterno;
    private javax.swing.JTextField jtf_unidaddatos;
    private javax.swing.JTextField jtf_usua;
    // End of variables declaration//GEN-END:variables

}
